{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "4EB1eqf3cQWb",
        "outputId": "60cf53da-6e9b-4448-8c77-46a52c78ea66"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
            "Requirement already satisfied: gensim in /usr/local/lib/python3.7/dist-packages (3.6.0)\n",
            "Requirement already satisfied: numpy>=1.11.3 in /usr/local/lib/python3.7/dist-packages (from gensim) (1.21.6)\n",
            "Requirement already satisfied: smart-open>=1.2.1 in /usr/local/lib/python3.7/dist-packages (from gensim) (5.2.1)\n",
            "Requirement already satisfied: six>=1.5.0 in /usr/local/lib/python3.7/dist-packages (from gensim) (1.15.0)\n",
            "Requirement already satisfied: scipy>=0.18.1 in /usr/local/lib/python3.7/dist-packages (from gensim) (1.7.3)\n"
          ]
        }
      ],
      "source": [
        "!pip install gensim"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "id": "5sUEjvcPcSjR"
      },
      "outputs": [],
      "source": [
        "import gensim"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "metadata": {
        "id": "UoddHebCccEA"
      },
      "outputs": [],
      "source": [
        "from gensim.models import Word2Vec, KeyedVectors"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "AQIC5kRFchcP"
      },
      "outputs": [],
      "source": [
        "## References: https://stackoverflow.com/questions/46433778/import-googlenews-vectors-negative300-bin\n"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import gensim.downloader as api\n",
        "\n",
        "wv = api.load('word2vec-google-news-300')\n",
        "\n",
        "vec_king = wv['king']"
      ],
      "metadata": {
        "id": "CVglJxe7apz5",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "d5285377-b400-4588-cf41-a0ce343d9961"
      },
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[==================================================] 100.0% 1662.8/1662.8MB downloaded\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "id": "jmw-5y9ie_WZ",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "a5ddd4c1-a748-414f-c772-cab5309c273e"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([ 1.25976562e-01,  2.97851562e-02,  8.60595703e-03,  1.39648438e-01,\n",
              "       -2.56347656e-02, -3.61328125e-02,  1.11816406e-01, -1.98242188e-01,\n",
              "        5.12695312e-02,  3.63281250e-01, -2.42187500e-01, -3.02734375e-01,\n",
              "       -1.77734375e-01, -2.49023438e-02, -1.67968750e-01, -1.69921875e-01,\n",
              "        3.46679688e-02,  5.21850586e-03,  4.63867188e-02,  1.28906250e-01,\n",
              "        1.36718750e-01,  1.12792969e-01,  5.95703125e-02,  1.36718750e-01,\n",
              "        1.01074219e-01, -1.76757812e-01, -2.51953125e-01,  5.98144531e-02,\n",
              "        3.41796875e-01, -3.11279297e-02,  1.04492188e-01,  6.17675781e-02,\n",
              "        1.24511719e-01,  4.00390625e-01, -3.22265625e-01,  8.39843750e-02,\n",
              "        3.90625000e-02,  5.85937500e-03,  7.03125000e-02,  1.72851562e-01,\n",
              "        1.38671875e-01, -2.31445312e-01,  2.83203125e-01,  1.42578125e-01,\n",
              "        3.41796875e-01, -2.39257812e-02, -1.09863281e-01,  3.32031250e-02,\n",
              "       -5.46875000e-02,  1.53198242e-02, -1.62109375e-01,  1.58203125e-01,\n",
              "       -2.59765625e-01,  2.01416016e-02, -1.63085938e-01,  1.35803223e-03,\n",
              "       -1.44531250e-01, -5.68847656e-02,  4.29687500e-02, -2.46582031e-02,\n",
              "        1.85546875e-01,  4.47265625e-01,  9.58251953e-03,  1.31835938e-01,\n",
              "        9.86328125e-02, -1.85546875e-01, -1.00097656e-01, -1.33789062e-01,\n",
              "       -1.25000000e-01,  2.83203125e-01,  1.23046875e-01,  5.32226562e-02,\n",
              "       -1.77734375e-01,  8.59375000e-02, -2.18505859e-02,  2.05078125e-02,\n",
              "       -1.39648438e-01,  2.51464844e-02,  1.38671875e-01, -1.05468750e-01,\n",
              "        1.38671875e-01,  8.88671875e-02, -7.51953125e-02, -2.13623047e-02,\n",
              "        1.72851562e-01,  4.63867188e-02, -2.65625000e-01,  8.91113281e-03,\n",
              "        1.49414062e-01,  3.78417969e-02,  2.38281250e-01, -1.24511719e-01,\n",
              "       -2.17773438e-01, -1.81640625e-01,  2.97851562e-02,  5.71289062e-02,\n",
              "       -2.89306641e-02,  1.24511719e-02,  9.66796875e-02, -2.31445312e-01,\n",
              "        5.81054688e-02,  6.68945312e-02,  7.08007812e-02, -3.08593750e-01,\n",
              "       -2.14843750e-01,  1.45507812e-01, -4.27734375e-01, -9.39941406e-03,\n",
              "        1.54296875e-01, -7.66601562e-02,  2.89062500e-01,  2.77343750e-01,\n",
              "       -4.86373901e-04, -1.36718750e-01,  3.24218750e-01, -2.46093750e-01,\n",
              "       -3.03649902e-03, -2.11914062e-01,  1.25000000e-01,  2.69531250e-01,\n",
              "        2.04101562e-01,  8.25195312e-02, -2.01171875e-01, -1.60156250e-01,\n",
              "       -3.78417969e-02, -1.20117188e-01,  1.15234375e-01, -4.10156250e-02,\n",
              "       -3.95507812e-02, -8.98437500e-02,  6.34765625e-03,  2.03125000e-01,\n",
              "        1.86523438e-01,  2.73437500e-01,  6.29882812e-02,  1.41601562e-01,\n",
              "       -9.81445312e-02,  1.38671875e-01,  1.82617188e-01,  1.73828125e-01,\n",
              "        1.73828125e-01, -2.37304688e-01,  1.78710938e-01,  6.34765625e-02,\n",
              "        2.36328125e-01, -2.08984375e-01,  8.74023438e-02, -1.66015625e-01,\n",
              "       -7.91015625e-02,  2.43164062e-01, -8.88671875e-02,  1.26953125e-01,\n",
              "       -2.16796875e-01, -1.73828125e-01, -3.59375000e-01, -8.25195312e-02,\n",
              "       -6.49414062e-02,  5.07812500e-02,  1.35742188e-01, -7.47070312e-02,\n",
              "       -1.64062500e-01,  1.15356445e-02,  4.45312500e-01, -2.15820312e-01,\n",
              "       -1.11328125e-01, -1.92382812e-01,  1.70898438e-01, -1.25000000e-01,\n",
              "        2.65502930e-03,  1.92382812e-01, -1.74804688e-01,  1.39648438e-01,\n",
              "        2.92968750e-01,  1.13281250e-01,  5.95703125e-02, -6.39648438e-02,\n",
              "        9.96093750e-02, -2.72216797e-02,  1.96533203e-02,  4.27246094e-02,\n",
              "       -2.46093750e-01,  6.39648438e-02, -2.25585938e-01, -1.68945312e-01,\n",
              "        2.89916992e-03,  8.20312500e-02,  3.41796875e-01,  4.32128906e-02,\n",
              "        1.32812500e-01,  1.42578125e-01,  7.61718750e-02,  5.98144531e-02,\n",
              "       -1.19140625e-01,  2.74658203e-03, -6.29882812e-02, -2.72216797e-02,\n",
              "       -4.82177734e-03, -8.20312500e-02, -2.49023438e-02, -4.00390625e-01,\n",
              "       -1.06933594e-01,  4.24804688e-02,  7.76367188e-02, -1.16699219e-01,\n",
              "        7.37304688e-02, -9.22851562e-02,  1.07910156e-01,  1.58203125e-01,\n",
              "        4.24804688e-02,  1.26953125e-01,  3.61328125e-02,  2.67578125e-01,\n",
              "       -1.01074219e-01, -3.02734375e-01, -5.76171875e-02,  5.05371094e-02,\n",
              "        5.26428223e-04, -2.07031250e-01, -1.38671875e-01, -8.97216797e-03,\n",
              "       -2.78320312e-02, -1.41601562e-01,  2.07031250e-01, -1.58203125e-01,\n",
              "        1.27929688e-01,  1.49414062e-01, -2.24609375e-02, -8.44726562e-02,\n",
              "        1.22558594e-01,  2.15820312e-01, -2.13867188e-01, -3.12500000e-01,\n",
              "       -3.73046875e-01,  4.08935547e-03,  1.07421875e-01,  1.06933594e-01,\n",
              "        7.32421875e-02,  8.97216797e-03, -3.88183594e-02, -1.29882812e-01,\n",
              "        1.49414062e-01, -2.14843750e-01, -1.83868408e-03,  9.91210938e-02,\n",
              "        1.57226562e-01, -1.14257812e-01, -2.05078125e-01,  9.91210938e-02,\n",
              "        3.69140625e-01, -1.97265625e-01,  3.54003906e-02,  1.09375000e-01,\n",
              "        1.31835938e-01,  1.66992188e-01,  2.35351562e-01,  1.04980469e-01,\n",
              "       -4.96093750e-01, -1.64062500e-01, -1.56250000e-01, -5.22460938e-02,\n",
              "        1.03027344e-01,  2.43164062e-01, -1.88476562e-01,  5.07812500e-02,\n",
              "       -9.37500000e-02, -6.68945312e-02,  2.27050781e-02,  7.61718750e-02,\n",
              "        2.89062500e-01,  3.10546875e-01, -5.37109375e-02,  2.28515625e-01,\n",
              "        2.51464844e-02,  6.78710938e-02, -1.21093750e-01, -2.15820312e-01,\n",
              "       -2.73437500e-01, -3.07617188e-02, -3.37890625e-01,  1.53320312e-01,\n",
              "        2.33398438e-01, -2.08007812e-01,  3.73046875e-01,  8.20312500e-02,\n",
              "        2.51953125e-01, -7.61718750e-02, -4.66308594e-02, -2.23388672e-02,\n",
              "        2.99072266e-02, -5.93261719e-02, -4.66918945e-03, -2.44140625e-01,\n",
              "       -2.09960938e-01, -2.87109375e-01, -4.54101562e-02, -1.77734375e-01,\n",
              "       -2.79296875e-01, -8.59375000e-02,  9.13085938e-02,  2.51953125e-01],\n",
              "      dtype=float32)"
            ]
          },
          "metadata": {},
          "execution_count": 9
        }
      ],
      "source": [
        "vec_king"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "vec_king.shape"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "AgGTA8SYmqBr",
        "outputId": "b77c96ae-5cd2-4c49-a566-77b738a9e297"
      },
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(300,)"
            ]
          },
          "metadata": {},
          "execution_count": 10
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "wv['cricket']"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "FvnKkPVxmvCr",
        "outputId": "4e9d3dec-ba3e-4aac-dafc-e36346072c6d"
      },
      "execution_count": 11,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([-3.67187500e-01, -1.21582031e-01,  2.85156250e-01,  8.15429688e-02,\n",
              "        3.19824219e-02, -3.19824219e-02,  1.34765625e-01, -2.73437500e-01,\n",
              "        9.46044922e-03, -1.07421875e-01,  2.48046875e-01, -6.05468750e-01,\n",
              "        5.02929688e-02,  2.98828125e-01,  9.57031250e-02,  1.39648438e-01,\n",
              "       -5.41992188e-02,  2.91015625e-01,  2.85156250e-01,  1.51367188e-01,\n",
              "       -2.89062500e-01, -3.46679688e-02,  1.81884766e-02, -3.92578125e-01,\n",
              "        2.46093750e-01,  2.51953125e-01, -9.86328125e-02,  3.22265625e-01,\n",
              "        4.49218750e-01, -1.36718750e-01, -2.34375000e-01,  4.12597656e-02,\n",
              "       -2.15820312e-01,  1.69921875e-01,  2.56347656e-02,  1.50146484e-02,\n",
              "       -3.75976562e-02,  6.95800781e-03,  4.00390625e-01,  2.09960938e-01,\n",
              "        1.17675781e-01, -4.19921875e-02,  2.34375000e-01,  2.03125000e-01,\n",
              "       -1.86523438e-01, -2.46093750e-01,  3.12500000e-01, -2.59765625e-01,\n",
              "       -1.06933594e-01,  1.04003906e-01, -1.79687500e-01,  5.71289062e-02,\n",
              "       -7.41577148e-03, -5.59082031e-02,  7.61718750e-02, -4.14062500e-01,\n",
              "       -3.65234375e-01, -3.35937500e-01, -1.54296875e-01, -2.39257812e-01,\n",
              "       -3.73046875e-01,  2.27355957e-03, -3.51562500e-01,  8.64257812e-02,\n",
              "        1.26953125e-01,  2.21679688e-01, -9.86328125e-02,  1.08886719e-01,\n",
              "        3.65234375e-01, -5.66406250e-02,  5.66406250e-02, -1.09375000e-01,\n",
              "       -1.66992188e-01, -4.54101562e-02, -2.00195312e-01, -1.22558594e-01,\n",
              "        1.31835938e-01, -1.31835938e-01,  1.03027344e-01, -3.41796875e-01,\n",
              "       -1.57226562e-01,  2.04101562e-01,  4.39453125e-02,  2.44140625e-01,\n",
              "       -3.19824219e-02,  3.20312500e-01, -4.41894531e-02,  1.08398438e-01,\n",
              "       -4.98046875e-02, -9.52148438e-03,  2.46093750e-01, -5.59082031e-02,\n",
              "        4.07714844e-02, -1.78222656e-02, -2.95410156e-02,  1.65039062e-01,\n",
              "        5.03906250e-01, -2.81250000e-01,  9.81445312e-02,  1.80664062e-02,\n",
              "       -1.83593750e-01,  2.53906250e-01,  2.25585938e-01,  1.63574219e-02,\n",
              "        1.81640625e-01,  1.38671875e-01,  3.33984375e-01,  1.39648438e-01,\n",
              "        1.45874023e-02, -2.89306641e-02, -8.39843750e-02,  1.50390625e-01,\n",
              "        1.67968750e-01,  2.28515625e-01,  3.59375000e-01,  1.22558594e-01,\n",
              "       -3.28125000e-01, -1.56250000e-01,  2.77343750e-01,  1.77001953e-02,\n",
              "       -1.46484375e-01, -4.51660156e-03, -4.46777344e-02,  1.75781250e-01,\n",
              "       -3.75000000e-01,  1.16699219e-01, -1.39648438e-01,  2.55859375e-01,\n",
              "       -1.96289062e-01, -2.57568359e-02, -5.41992188e-02, -2.51464844e-02,\n",
              "       -1.93359375e-01, -3.17382812e-02, -8.74023438e-02, -1.32812500e-01,\n",
              "       -2.12402344e-02,  4.33593750e-01, -5.20019531e-02,  3.46679688e-02,\n",
              "        8.00781250e-02,  3.41796875e-02,  1.99218750e-01, -2.39257812e-02,\n",
              "       -2.37304688e-01,  1.93359375e-01,  7.32421875e-02, -2.87109375e-01,\n",
              "        1.25000000e-01,  8.44726562e-02,  1.30859375e-01, -2.19726562e-01,\n",
              "       -1.61132812e-01, -2.63671875e-01, -5.46875000e-01, -2.96875000e-01,\n",
              "        3.44238281e-02, -2.87109375e-01, -1.93359375e-01, -1.61132812e-01,\n",
              "       -3.84765625e-01, -2.14843750e-01, -6.22558594e-03, -1.27929688e-01,\n",
              "       -1.00097656e-01, -6.21093750e-01,  3.78906250e-01, -4.58984375e-01,\n",
              "        1.44531250e-01, -9.13085938e-02, -3.08593750e-01,  2.23632812e-01,\n",
              "        7.86132812e-02, -2.16796875e-01,  8.78906250e-02, -1.66992188e-01,\n",
              "        1.14746094e-02, -2.53906250e-01, -6.25000000e-02,  6.04248047e-03,\n",
              "        1.56250000e-01,  4.37500000e-01, -2.23632812e-01, -2.32421875e-01,\n",
              "        2.75390625e-01,  2.39257812e-01,  4.49218750e-02, -7.51953125e-02,\n",
              "        5.74218750e-01, -2.61230469e-02, -1.21582031e-01,  2.44140625e-01,\n",
              "       -3.37890625e-01,  8.59375000e-02, -7.71484375e-02,  4.85839844e-02,\n",
              "        1.43554688e-01,  4.25781250e-01, -4.29687500e-02, -1.08398438e-01,\n",
              "        1.19628906e-01, -1.91406250e-01, -2.12890625e-01, -2.87109375e-01,\n",
              "       -1.14746094e-01, -2.04101562e-01, -2.06298828e-02, -2.53906250e-01,\n",
              "        8.25195312e-02, -3.97949219e-02, -1.57226562e-01,  1.34765625e-01,\n",
              "        2.08007812e-01, -1.78710938e-01, -2.00195312e-02, -8.34960938e-02,\n",
              "       -1.20605469e-01,  4.29687500e-02, -1.94335938e-01, -1.32812500e-01,\n",
              "       -2.17285156e-02, -2.35351562e-01, -3.63281250e-01,  1.51367188e-01,\n",
              "        9.32617188e-02,  1.63085938e-01,  1.02050781e-01, -4.27734375e-01,\n",
              "        2.83203125e-01,  2.74658203e-04, -3.20312500e-01,  1.68457031e-02,\n",
              "        4.06250000e-01, -5.24902344e-02,  7.91015625e-02, -1.41601562e-01,\n",
              "        5.27343750e-01, -1.26953125e-01,  4.74609375e-01, -6.64062500e-02,\n",
              "        3.41796875e-01, -1.78710938e-01,  3.69140625e-01, -2.05078125e-01,\n",
              "        5.82885742e-03, -1.84570312e-01, -8.88671875e-02, -1.81640625e-01,\n",
              "       -4.80957031e-02,  4.39453125e-01,  2.12890625e-01, -3.07617188e-02,\n",
              "        9.32617188e-02,  2.40234375e-01,  2.39257812e-01,  2.51953125e-01,\n",
              "       -1.98974609e-02,  1.24511719e-01, -4.73632812e-02, -2.13623047e-02,\n",
              "        3.12500000e-02,  3.05175781e-02,  2.79296875e-01,  9.08203125e-02,\n",
              "       -2.02148438e-01, -2.19726562e-02, -2.63671875e-01,  8.78906250e-02,\n",
              "       -1.07421875e-01, -2.49023438e-01, -1.22070312e-02,  1.73828125e-01,\n",
              "       -9.91210938e-02,  7.27539062e-02,  2.59765625e-01, -4.60937500e-01,\n",
              "        3.59375000e-01, -2.25585938e-01,  1.87988281e-02, -2.19726562e-01,\n",
              "       -2.08984375e-01, -1.51367188e-01,  8.64257812e-02,  1.11694336e-02,\n",
              "        6.93359375e-02, -2.99072266e-02,  1.43554688e-01,  1.89453125e-01,\n",
              "       -1.32812500e-01,  4.72656250e-01, -1.40625000e-01, -2.52685547e-02,\n",
              "        1.91406250e-01, -2.63671875e-01, -1.39648438e-01,  1.09375000e-01,\n",
              "        1.97753906e-02,  2.49023438e-01, -1.42578125e-01,  4.15039062e-02],\n",
              "      dtype=float32)"
            ]
          },
          "metadata": {},
          "execution_count": 11
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "wv.most_similar('cricket')"
      ],
      "metadata": {
        "id": "e54uZ09viYfb",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "a5220ea6-3737-449e-8a1d-441b78adecae"
      },
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[('cricketing', 0.8372225165367126),\n",
              " ('cricketers', 0.8165745735168457),\n",
              " ('Test_cricket', 0.8094818592071533),\n",
              " ('Twenty##_cricket', 0.8068488240242004),\n",
              " ('Twenty##', 0.7624266147613525),\n",
              " ('Cricket', 0.7541396617889404),\n",
              " ('cricketer', 0.7372579574584961),\n",
              " ('twenty##', 0.7316356897354126),\n",
              " ('T##_cricket', 0.7304614782333374),\n",
              " ('West_Indies_cricket', 0.698798656463623)]"
            ]
          },
          "metadata": {},
          "execution_count": 12
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "wv.most_similar('happy')"
      ],
      "metadata": {
        "id": "vw5kiHNOik2z",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "8e628831-7c1d-47e8-8dea-7ae664dbd31a"
      },
      "execution_count": 13,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[('glad', 0.7408890128135681),\n",
              " ('pleased', 0.6632171273231506),\n",
              " ('ecstatic', 0.6626912355422974),\n",
              " ('overjoyed', 0.6599286794662476),\n",
              " ('thrilled', 0.6514049768447876),\n",
              " ('satisfied', 0.6437950134277344),\n",
              " ('proud', 0.636042058467865),\n",
              " ('delighted', 0.627237856388092),\n",
              " ('disappointed', 0.6269949674606323),\n",
              " ('excited', 0.6247666478157043)]"
            ]
          },
          "metadata": {},
          "execution_count": 13
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "wv.similarity(\"hockey\",\"sports\")"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "5H4XANCFiz7L",
        "outputId": "2c61e22c-48fd-407a-bdbf-bada31b33582"
      },
      "execution_count": 14,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "0.53541523"
            ]
          },
          "metadata": {},
          "execution_count": 14
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "vec=wv['king']-wv['man']+wv['woman']"
      ],
      "metadata": {
        "id": "w7VVwVI8i90p"
      },
      "execution_count": 15,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "vec"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Yi--OSxMjH_R",
        "outputId": "e05184ee-8f95-4faf-e510-b3fe99e92ca4"
      },
      "execution_count": 16,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array([ 4.29687500e-02, -1.78222656e-01, -1.29089355e-01,  1.15234375e-01,\n",
              "        2.68554688e-03, -1.02294922e-01,  1.95800781e-01, -1.79504395e-01,\n",
              "        1.95312500e-02,  4.09919739e-01, -3.68164062e-01, -3.96484375e-01,\n",
              "       -1.56738281e-01,  1.46484375e-03, -9.30175781e-02, -1.16455078e-01,\n",
              "       -5.51757812e-02, -1.07574463e-01,  7.91015625e-02,  1.98974609e-01,\n",
              "        2.38525391e-01,  6.34002686e-02, -2.17285156e-02,  0.00000000e+00,\n",
              "        4.72412109e-02, -2.17773438e-01, -3.44726562e-01,  6.37207031e-02,\n",
              "        3.16406250e-01, -1.97631836e-01,  8.59375000e-02, -8.11767578e-02,\n",
              "       -3.71093750e-02,  3.15551758e-01, -3.41796875e-01, -4.68750000e-02,\n",
              "        9.76562500e-02,  8.39843750e-02, -9.71679688e-02,  5.17578125e-02,\n",
              "       -5.00488281e-02, -2.20947266e-01,  2.29492188e-01,  1.26403809e-01,\n",
              "        2.49023438e-01,  2.09960938e-02, -1.09863281e-01,  5.81054688e-02,\n",
              "       -3.35693359e-02,  1.29577637e-01,  2.41699219e-02,  3.48129272e-02,\n",
              "       -2.60009766e-01,  2.42309570e-01, -3.21777344e-01,  1.45416260e-02,\n",
              "       -1.59179688e-01, -8.37402344e-02,  1.65039062e-01,  1.58691406e-03,\n",
              "        3.09570312e-01,  3.16406250e-01,  7.38525391e-03,  2.41210938e-01,\n",
              "        4.90722656e-02, -9.86328125e-02,  2.90527344e-02,  1.49414062e-01,\n",
              "       -4.83398438e-02,  2.35595703e-01,  2.21191406e-01,  1.25488281e-01,\n",
              "       -1.38671875e-01,  1.54296875e-01,  7.18994141e-02,  1.29882812e-01,\n",
              "       -1.05712891e-01,  6.00585938e-02,  3.14697266e-01,  1.09619141e-01,\n",
              "        8.49609375e-02,  7.71484375e-02, -2.17285156e-02,  6.11572266e-02,\n",
              "       -1.89941406e-01,  2.07519531e-01, -1.63085938e-01,  1.13525391e-01,\n",
              "        2.01171875e-01,  6.06689453e-02,  1.27929688e-01, -3.11279297e-01,\n",
              "       -2.80151367e-01, -1.55883789e-01,  4.15039062e-02,  9.87854004e-02,\n",
              "        1.69555664e-01, -3.49121094e-02,  2.08496094e-01, -9.89990234e-02,\n",
              "        4.39453125e-03, -7.27539062e-02, -4.24804688e-02, -4.09179688e-01,\n",
              "       -2.76367188e-01,  1.64062500e-01, -5.57617188e-01, -2.02199936e-01,\n",
              "        2.12158203e-01, -9.81445312e-02,  2.30773926e-01,  2.75878906e-01,\n",
              "        1.68092728e-01, -4.50439453e-02,  1.71615601e-01, -3.77075195e-01,\n",
              "       -3.52478027e-03, -3.01513672e-01,  1.74224854e-01,  3.30078125e-01,\n",
              "        2.00683594e-01,  1.17736816e-01, -1.37695312e-01, -1.07421875e-01,\n",
              "        8.61816406e-02,  1.06445312e-01,  1.44531250e-01,  3.05175781e-03,\n",
              "        1.80664062e-02,  3.73535156e-02,  7.32421875e-03,  1.32812500e-01,\n",
              "        9.61914062e-02,  3.35998535e-01,  1.81152344e-01,  2.40905762e-01,\n",
              "       -8.49609375e-02, -1.10107422e-01,  2.11914062e-01,  5.85937500e-03,\n",
              "        1.62109375e-01, -4.15527344e-01,  1.39160156e-01,  1.01562500e-01,\n",
              "        1.44531250e-01, -1.09375000e-01,  4.88281250e-02,  6.15234375e-02,\n",
              "       -1.69921875e-01,  3.28369141e-02,  5.56640625e-02,  1.47460938e-01,\n",
              "       -2.24609375e-02, -2.73925781e-01, -2.81982422e-01, -1.39160156e-01,\n",
              "       -1.81884766e-01,  9.33532715e-02,  1.21093750e-01, -5.37109375e-03,\n",
              "       -1.87500000e-01,  3.05175781e-04,  5.52734375e-01, -9.71679688e-02,\n",
              "       -1.81640625e-01, -1.51855469e-01,  7.76367188e-02, -2.38281250e-01,\n",
              "       -2.63977051e-02,  2.25555420e-01, -3.02734375e-01,  1.34765625e-01,\n",
              "        3.23242188e-01,  1.25976562e-01,  3.51562500e-02, -2.04345703e-01,\n",
              "        2.96142578e-01,  1.03149414e-01, -4.76074219e-03,  1.69189453e-01,\n",
              "       -3.50585938e-01,  2.46887207e-02, -3.90502930e-01, -2.70507812e-01,\n",
              "        1.85241699e-02,  1.04492188e-01,  2.84179688e-01,  1.35009766e-01,\n",
              "       -5.95703125e-02,  1.88232422e-01,  8.88214111e-02,  3.24707031e-02,\n",
              "       -8.98437500e-02,  5.45043945e-02,  5.65185547e-02,  1.56860352e-01,\n",
              "       -9.70458984e-03, -7.08007812e-02,  5.71289062e-02, -3.08837891e-01,\n",
              "       -1.91894531e-01,  4.83398438e-02,  5.22460938e-02, -1.59667969e-01,\n",
              "       -4.49218750e-02, -7.37304688e-02,  5.51757812e-02,  2.12402344e-01,\n",
              "        2.05322266e-01, -2.73437500e-02,  7.86132812e-02,  3.19091797e-01,\n",
              "       -1.56982422e-01, -3.92822266e-01,  4.00390625e-02,  9.93652344e-02,\n",
              "       -1.97372437e-02, -8.25195312e-02,  2.53906250e-02,  3.10668945e-02,\n",
              "       -3.63769531e-02,  1.48925781e-02,  2.20703125e-01, -5.98144531e-02,\n",
              "        6.15234375e-02, -7.14111328e-02, -4.00390625e-02, -1.03515625e-01,\n",
              "        9.22851562e-02,  2.71789551e-01, -2.30224609e-01, -2.62695312e-01,\n",
              "       -5.61523438e-01,  1.38549805e-02,  1.09863281e-01,  7.22656250e-02,\n",
              "        4.58984375e-02, -3.31802368e-02, -8.03833008e-02, -6.10351562e-03,\n",
              "        2.09960938e-01, -3.86840820e-01,  1.44645691e-01,  8.05664062e-02,\n",
              "        2.96264648e-01, -1.17187500e-02, -2.34680176e-01,  1.32019043e-01,\n",
              "        2.53906250e-01, -2.46826172e-01,  1.03759766e-01,  1.14013672e-01,\n",
              "        1.71875000e-01, -5.61523438e-03,  2.05078125e-01,  6.34765625e-02,\n",
              "       -4.51293945e-01, -2.26562500e-01, -1.03027344e-01, -1.31469727e-01,\n",
              "        3.75976562e-02,  2.70996094e-01, -2.39257812e-01,  3.80859375e-02,\n",
              "       -3.90625000e-02, -9.42382812e-02,  8.30078125e-03,  7.03125000e-02,\n",
              "        2.75390625e-01,  3.31542969e-01, -1.07421875e-02,  3.72192383e-01,\n",
              "       -1.24511719e-01,  1.94335938e-01, -1.35620117e-01, -3.09570312e-01,\n",
              "       -2.36328125e-01, -1.26953125e-02, -2.76855469e-01,  1.57714844e-01,\n",
              "        3.07617188e-01, -2.32910156e-01,  3.25439453e-01,  1.36718750e-02,\n",
              "        1.99462891e-01, -2.61840820e-02, -8.08105469e-02, -7.50732422e-02,\n",
              "       -4.11109924e-02,  1.95556641e-01, -5.64270020e-02, -2.79296875e-01,\n",
              "       -2.75390625e-01, -4.04296875e-01, -1.75781250e-02, -5.85937500e-03,\n",
              "       -7.71484375e-02,  1.33789062e-01,  2.36816406e-01,  2.01538086e-01],\n",
              "      dtype=float32)"
            ]
          },
          "metadata": {},
          "execution_count": 16
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "wv.most_similar([vec])"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "3PkeelKkjI8h",
        "outputId": "f2a9d0f4-b620-44ce-f8ac-d771a0787653"
      },
      "execution_count": 17,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[('king', 0.8449392318725586),\n",
              " ('queen', 0.7300517559051514),\n",
              " ('monarch', 0.6454660892486572),\n",
              " ('princess', 0.6156251430511475),\n",
              " ('crown_prince', 0.5818676948547363),\n",
              " ('prince', 0.5777117609977722),\n",
              " ('kings', 0.5613663792610168),\n",
              " ('sultan', 0.5376776456832886),\n",
              " ('Queen_Consort', 0.5344247817993164),\n",
              " ('queens', 0.5289887189865112)]"
            ]
          },
          "metadata": {},
          "execution_count": 17
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [],
      "metadata": {
        "id": "nAN01EbsjNQM"
      },
      "execution_count": null,
      "outputs": []
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "provenance": []
    },
    "gpuClass": "standard",
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}